﻿
namespace ATA.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.DieuKienGiamGia"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class DieuKienGiamGiaEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the DieuKienId property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxDieuKienId;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DieuKienId property.
		/// </summary>
		protected System.Windows.Forms.Label uxDieuKienIdLabel;
		
		/// <summary>
		/// TextBox for the DieuKienChung property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxDieuKienChung;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DieuKienChung property.
		/// </summary>
		protected System.Windows.Forms.Label uxDieuKienChungLabel;
		
		/// <summary>
		/// DataTimePicker for the LastUpdate property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxLastUpdate;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the LastUpdate property.
		/// </summary>
		protected System.Windows.Forms.Label uxLastUpdateLabel;
		
		/// <summary>
		/// TextBox for the UpdateBy property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxUpdateBy;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the UpdateBy property.
		/// </summary>
		protected System.Windows.Forms.Label uxUpdateByLabel;
		
		/// <summary>
		/// CheckBox for the IsActive property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxIsActive;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IsActive property.
		/// </summary>
		protected System.Windows.Forms.Label uxIsActiveLabel;
		#endregion
		
		#region Main entity
		private Entities.DieuKienGiamGia _DieuKienGiamGia;
		/// <summary>
		/// Gets or sets the <see cref="Entities.DieuKienGiamGia"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.DieuKienGiamGia"/> instance.</value>
		public Entities.DieuKienGiamGia DieuKienGiamGia
		{
			get {return this._DieuKienGiamGia;}
			set
			{
				this._DieuKienGiamGia = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxDieuKienId.DataBindings.Clear();
			this.uxDieuKienId.DataBindings.Add("Text", this.uxBindingSource, "DieuKienId", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDieuKienChung.DataBindings.Clear();
			this.uxDieuKienChung.DataBindings.Add("Text", this.uxBindingSource, "DieuKienChung", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxLastUpdate.DataBindings.Clear();
			this.uxLastUpdate.DataBindings.Add("Value", this.uxBindingSource, "LastUpdate", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxUpdateBy.DataBindings.Clear();
			this.uxUpdateBy.DataBindings.Add("Text", this.uxBindingSource, "UpdateBy", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIsActive.DataBindings.Clear();
			this.uxIsActive.DataBindings.Add("Checked", this.uxBindingSource, "IsActive", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="DieuKienGiamGiaEditControlBase"/> class.
		/// </summary>
		public DieuKienGiamGiaEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_DieuKienGiamGia != null) _DieuKienGiamGia.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxDieuKienId = new System.Windows.Forms.TextBox();
			uxDieuKienIdLabel = new System.Windows.Forms.Label();
			this.uxDieuKienChung = new System.Windows.Forms.TextBox();
			uxDieuKienChungLabel = new System.Windows.Forms.Label();
			this.uxLastUpdate = new System.Windows.Forms.DateTimePicker();
			uxLastUpdateLabel = new System.Windows.Forms.Label();
			this.uxUpdateBy = new System.Windows.Forms.TextBox();
			uxUpdateByLabel = new System.Windows.Forms.Label();
			this.uxIsActive = new System.Windows.Forms.CheckBox();
			uxIsActiveLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxDieuKienIdLabel
			//
			this.uxDieuKienIdLabel.Text = "DieuKienId:";
			this.uxDieuKienIdLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxDieuKienIdLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDieuKienIdLabel);			
			//
			// uxDieuKienId
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDieuKienId);
			this.uxDieuKienId.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxDieuKienId);
			//
			// uxDieuKienChungLabel
			//
			this.uxDieuKienChungLabel.Text = "DieuKienChung:";
			this.uxDieuKienChungLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxDieuKienChungLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDieuKienChungLabel);			
			//
			// uxDieuKienChung
			//
			this.uxDieuKienChung.Width = 250;
			this.uxDieuKienChung.Multiline = true;
			//this.uxDieuKienChung.Height = 80;
			//this.uxTableLayoutPanel.Controls.Add(this.uxDieuKienChung);
			this.uxDieuKienChung.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxDieuKienChung);
			//
			// uxLastUpdateLabel
			//
			this.uxLastUpdateLabel.Text = "LastUpdate:";
			this.uxLastUpdateLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxLastUpdateLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxLastUpdateLabel);			
			//
			// uxLastUpdate
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxLastUpdate);
			this.uxLastUpdate.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxLastUpdate);
			//
			// uxUpdateByLabel
			//
			this.uxUpdateByLabel.Text = "UpdateBy:";
			this.uxUpdateByLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxUpdateByLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxUpdateByLabel);			
			//
			// uxUpdateBy
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxUpdateBy);
			this.uxUpdateBy.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxUpdateBy);
			//
			// uxIsActiveLabel
			//
			this.uxIsActiveLabel.Text = "IsActive:";
			this.uxIsActiveLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxIsActiveLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIsActiveLabel);			
			//
			// uxIsActive
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIsActive);
			this.uxIsActive.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxIsActive);
			// 
			// DieuKienGiamGiaEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "DieuKienGiamGiaEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
